package com.qfedu.stussm.controller;

import com.qfedu.stussm.entity.Tccard;
import com.qfedu.stussm.entity.Tprize;
import com.qfedu.stussm.service.intf.TccardService;
import com.qfedu.stussm.service.intf.TprizeService;
import com.qfedu.stussm.vo.PageBeanVo;
import com.qfedu.stussm.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("api/tprize/")
public class TprizeController {
    @Autowired
    private TprizeService tprizeService;
    /*
     * 查询
     * */
    @GetMapping("tprizelist.do")
    @ResponseBody
    public PageBeanVo query(String t_name, int page, int limit){
        return tprizeService.selectLikeAll(t_name,page,limit);
    }
    /*
     * 新增
     * */
    @PostMapping("add.do")
    public R add(Tprize tprize){
        return tprizeService.add(tprize);
    }
    @PostMapping("delete.do")
    public R delete(int t_tcid){
        return tprizeService.delete(t_tcid);
    }
    @PostMapping("update.do")
    public R update(Tprize tprize){
        return tprizeService.update(tprize);
    }

}
